<include file="public@header"/>

<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('Information/index')}">待办信息列表</a></li>
        <li class="active"><a href="{:url('Information/edit')}">编辑</a></li>
    </ul>
    <div class="row margin-top-20">
        <div class="col-md-12 col-lg-10">
            <form action="{:url('Information/editPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
                <input type="hidden" name="id" value="{$data->id}">
                <div class="row">
                    <div class="col-md-12">
                        <table class="table table-bordered chase_classroom_table">
                            <tr>
                                <th>校区<span class="form-required">*</span></th>
                                <td>
                                    <if condition="isset($super_admin) && $super_admin eq 1">
                                        <select class="form-control" name="school_id" style="width: 180px;">
                                            <option value='0'>全部</option>
                                            <notempty name="campus">
                                                <volist name="campus" id="vo">
                                                    <if condition="isset($data.school_id) && $data.school_id eq $vo.id">
                                                        <option value="{$vo.id}" selected>{$vo.name}</option>
                                                        <else/>
                                                        <option value="{$vo.id}">{$vo.name}</option>
                                                    </if>
                                                </volist>
                                            </notempty>
                                        </select>
                                    <else/>
                                        <select class="form-control" name="school_id" readonly style="width: 180px;">
                                            <notempty name="campus">
                                                <volist name="campus" id="vo">
                                                    <if condition="isset($data.school_id) && $data.school_id eq $vo.id">
                                                        <option value="{$vo.id}" selected>{$vo.name}</option>
                                                    </if>
                                                </volist>
                                            </notempty>
                                        </select>
                                    </if>

                                </td>
                            </tr>
                            <tr>
                                <th>标题<span class="form-required">*</span></th>
                                <td>
                                    <if condition="isset($super_admin) && $super_admin eq 1">
                                        <input type="text" class="form-control" name="title" value="{$data->title}">
                                    <else/>
                                        <input type="text" class="form-control" readonly name="title" value="{$data->title}">
                                    </if>
                                </td>
                            </tr>
                            <tr>
                                <th>内容<span class="form-required">*</span></th>
                                <td>
                                    <if condition="isset($super_admin) && $super_admin eq 1">
                                        <textarea class="form-control" name="content" rows="8">{$data->content}</textarea>
                                        <else/>
                                        <textarea class="form-control" readonly name="content" rows="8">{$data->content}</textarea>
                                    </if>
                                </td>
                            </tr>
                            <tr>
                                <th>完成者<span class="form-required">*</span></th>
                                <td>
                                    <if condition="isset($super_admin) && $super_admin eq 1">
                                        <input type="text" class="form-control" id="solved_uid" name="solve" value="{$data->solved_name}">
                                    <else/>
                                        <input type="text" class="form-control" id="solved_uid" readonly name="solve" value="{$data->solved_name}">
                                    </if>
                                    <input type="hidden" class="form-control" id="cur_solved_uid" name="solved_uid" value="{$data->solved_uid}">
                                </td>
                            </tr>
                            <tr>
                                <th>状态<span class="form-required">*</span></th>
                                <td>
                                    <select class="form-control" id="input-status" name="status" style="width: 180px;">
                                        <if condition="isset($data.status) && $data.status eq 1">
                                            <option value="0">待办</option>
                                            <option value="1" selected>已处理</option>
                                        <else/>
                                            <option value="0" selected>待办</option>
                                            <option value="1">已处理</option>
                                        </if>
                                    </select>
                                </td>
                            </tr>
                        </table>

                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
                                <a class="btn btn-default" href="{:url('Information/index')}">{:lang('BACK')}</a>
                            </div>
                        </div>
                    </div>
                </div>
            </form>

        </div>
    </div>
</div>
<!--ajax layer 弹窗-->
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript" src="__STATIC__/js/jquery.autocomplete.js"></script>

<script type="text/javascript">
    $(document).ready(function() {

        var url = "{:url('Information/ajax_user')}";

        $('#solved_uid').devbridgeAutocomplete({
            serviceUrl: url,
            autoSelectFirst: true,
            minChars: 1,
            showNoSuggestionNotice: true,
            onSelect: function (suggestion) {
                //设置完成者ID
                $('#cur_solved_uid').val(suggestion.data);
            }
        });
    });
</script>

</body>
